<template>
  <view class="container screen-width">
    <view class="form-box">
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">活动标题</view>
        </view>
        <input placeholder="请输入活动标题" v-model="form.title"/>
      </view>
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">活动内容</view>
        </view>
        <textarea maxlength="10000" placeholder="请输入内容" v-model="form.synopsis" />
      </view>
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">开始时间</view>
        </view>
        <input style="background: #dddddd" v-if="type === '2'" disabled="true" v-model="form.beginDate" >
        <input v-else disabled="true" @click="showStart = true" placeholder="请选择开始时间" v-model="form.beginDate" />
      </view>
      <view class="item">
        <view class="flex items-middle lable-info">
          <view class="must">*</view>
          <view class="lable">结束时间</view>
        </view>
        <input style="background: #dddddd" v-if="type === '2'" disabled="true" v-model="form.endDate" >
        <input v-else disabled="true" @click="showEnd = true" placeholder="请选择结束时间" v-model="form.endDate" />
      </view>
      <view class="btn" @click="submitForm">保存提交</view>
    </view>
    

    <van-popup v-model="showStart" position="bottom" :style="{ height: '40%' }">
      <van-datetime-picker
        type="datetime"
        v-model="currentDate"
        @confirm="onConfirmTimes"
        @cancel="cancel"
      />
    </van-popup>
    <van-popup v-model="showEnd" position="bottom" :style="{ height: '40%' }">
      <van-datetime-picker
        type="datetime"
        v-model="currentDate2"
        @confirm="onConfirmTimes2"
        @cancel="cancel"
      />
    </van-popup>
  </view>
</template>

<script src="./index.js"></script>
<style lang="less" scoped src="./index.less"></style>
